home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / picman15.zip / CUSTCONV.H < prev    next >
C/C++ Source or Header  |  1992-12-07  |  5KB  |  133 lines

  1. #include <string.h>
  2.  
  3. #ifndef CUSTOM_H
  4. // Initialiation file
  5. #define SRC_SECTION   "Sources"
  6. #define DST_SECTION   "Destinations"
  7.  
  8. // Common entry points
  9. #define MAGICPROC           "Magic"
  10. #define GETDESCRIPTIONPROC  "GetDescription"
  11. #define GETEXTENSIONPROC    "GetExtension"
  12. #define GETFLAGSPROC        "GetFlags"
  13. #define SETOPTIONSPROC      "SetOptions"
  14. #define CLEANUPPROC         "CleanUp"
  15.  
  16. // Reader entry points
  17. #define READHEADERPROC      "ReadHeader"
  18. #define READROWPROC         "ReadRow"
  19. #define READFILEPROC        "ReadFile"
  20.  
  21. // Writer entry points
  22. #define WRITEHEADERPROC     "WriteHeader"
  23. #define WRITEROWPROC        "WriteRow"
  24. #define WRITEFILEPROC       "WriteFile"
  25. #define ENDWRITEPROC        "EndWrite"
  26.  
  27.  
  28. // Color palette type
  29. typedef BYTE PAL[3][256];
  30. typedef BYTE * PPAL[256];
  31. typedef BYTE FAR * LPPAL[256];
  32.  
  33. // I/I means INPUT parameter for both ReadHeader and WriteHeader
  34. // O/I means OUTPUT parameter for ReadHeader and INPUT for WriteHeader
  35. // O/O means OUTPUT parameter for both ReadHeader and WriteHeader
  36.  
  37. // Parameter block for ReadHeader / WriteHeader
  38. typedef struct
  39. {
  40.     OFSTRUCT of;    // I/I Opened Source/Destination file
  41.     int  file;      // I/I             --/--
  42.     WORD w;         // O/I Width
  43.     WORD h;         // O/I Height
  44.     WORD bps;       // O/I 1,4,8 or 24
  45.     WORD numcolors; // O/I Actual number of colors/shades ( 0 for bps == 24 )
  46.     WORD nplanes;   // O/O Number of bitplanes
  47.     WORD bplin;     // O/O Bytes per one bitplane
  48.     DWORD   xres;   // O/I X Resolution
  49.     DWORD   yres;   // O/I Y Resolution
  50.     WORD    resunit;// O/I Resolution unit (See below)
  51.     DWORD   flags;  // ??? Miscellaneous flags (See below)
  52.     PAL     pal;    // O/I Color palette
  53. } INFO;
  54.  
  55. typedef INFO * PINFO;
  56. typedef INFO FAR * LPINFO;
  57.  
  58. // Values for resunit
  59. #define RES_UNKNOWN     0
  60. #define RES_NOUNIT      1
  61. #define RES_SCREEN      2
  62. #define RES_DPI         3
  63. #define RES_DPCM        4
  64. #define RES_DPM         5
  65.  
  66. // Bits for INFO.flags
  67. // Color info bits
  68. #define INFO_COLOR      1l      // O/I Image is colored
  69. #define INFO_PALETTE    2l      // O/I Image is paletted
  70. #define INFO_NEGATIVE   4l      // O/I Image is negative
  71. // File organization bits
  72. #define INFO_TEMPFILE   8l      // O/O Only by temporary file
  73. #define INFO_COMPRESSED 0x10l   // O/O Image is compressed
  74. #define INFO_FORWARD    0x20l   // O/O Up to down
  75. #define INFO_BACKWARD   0x40l   // O/O Down to up
  76. #define INFO_RANDOM     0x80l   // O/O Random access is allowed
  77. // Row organization bits
  78. #define INFO_PACKED     0x100l  // O/O (bps < 8) bits are shifted together
  79. #define INFO_SEPARATE   0x200l  // O/O (bps !=8) bitplanes are separated
  80.  
  81. // Bits for GetFlags()
  82. // Destination capabilites bits
  83. #define INFO_1BPS       0x400l  // -/O  Accepts 1-bit data
  84. #define INFO_4BPS       0x800l  // -/O  Accepts 4-bit data
  85. #define INFO_8BPS       0x1000l // -/O  Accepts 8-bit data
  86. #define INFO_24BPS      0x2000l // -/O  Accepts 24-bit data
  87. #define INFO_GRAY       0x4000l // -/O  Accepts true gray data
  88. #define INFO_STDPAL     0x8000l // -/O  Requires std. EGA/VGA palette
  89. #define INFO_ANYPAL     0x10000l// -/O  Accepts any palette
  90. // Source/Destination capabilites bits
  91. #define INFO_HASOPTIONS 0x20000l// O/O  Has SetOptions()
  92. #define INFO_NOFILE     0x40000l// O/O  Do not open src/dst file
  93.  
  94. // ALL OTHER BITS ARE RESERVED
  95.  
  96. // Return values for Magic
  97. #define SRC_MAGIC   0x1234
  98. #define DST_MAGIC   0x4321
  99.  
  100. // Common return values
  101. #define OK          0
  102. #define BADFORMAT   1   // Bad signature
  103. #define UNSUPPORTED 2   // Unsupported subformat
  104. #define BADFILE     3   // Error in file structure
  105. #define CANNOTOPEN  4   // Cannot open src/dest
  106. #define INTERNAL    5   // Reserved
  107. #define BADDLL      6   // Error initializing DLL
  108. #define BADREQUEST  7   // Unsupported type of conversion
  109. #define BADTEMPFILE 8   // Error creating/reading tempfile
  110. #define NOMEMORY    9   // No enough global heap
  111. #define NODISK      10  // No enough disk space
  112. #define USERABORT   11  // Cancelled by user
  113. #define BADPARMS    12  // Conflicting parameters
  114.  
  115. WORD  FAR PASCAL Magic(void);
  116. void  FAR PASCAL GetDescription(LPSTR);
  117. void  FAR PASCAL GetExtension(LPSTR);
  118. DWORD FAR PASCAL GetFlags(void);
  119. int   FAR PASCAL SetOptions(HWND,void far *);
  120. int   FAR PASCAL GetPrivateSize(void);
  121. void  FAR PASCAL CleanUp(void far *);
  122.  
  123. int   FAR PASCAL ReadHeader(LPINFO,void far * );
  124. int   FAR PASCAL ReadRow(int,LPBYTE,void far *);
  125. int   FAR PASCAL ReadFile(int, void far *, FARPROC);
  126.  
  127. int   FAR PASCAL WriteHeader(LPINFO,void far * );
  128. int   FAR PASCAL WriteRow(int,LPBYTE,void far *);
  129. int   FAR PASCAL WriteFile(int,void far *, FARPROC);
  130. int   FAR PASCAL EndWrite(void far *);
  131. #define CUSTOM_H
  132. #endif
  133.